Skip to content

feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293

Open
fengmk2 wants to merge 1 commit intomainfrom
windows-installer
Open

feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293
fengmk2 wants to merge 1 commit intomainfrom
windows-installer

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 4, 2026

Add a standalone vp-setup.exe Windows installer binary that installs
the vp CLI without requiring PowerShell, complementing the existing
irm https://vite.plus/ps1 | iex script-based installer.

  • Create vite_setup shared library crate extracting installation logic
    (platform detection, registry queries, integrity verification, tarball
    extraction, symlink/junction management) from vite_global_cli
  • Create vite_installer binary crate producing vp-setup.exe with
    interactive prompts, silent mode (-y), progress bars, and Windows PATH
    modification via direct registry API (no PowerShell dependency)
  • Update vite_global_cli to use vite_setup instead of inline upgrade
    modules, ensuring upgrade and installer share identical logic
  • Add CI build/upload steps for installer in release workflow, attached
    as GitHub Release assets
  • Add RFC document at rfcs/windows-installer.md

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 4, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 2e26da4
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d6812dde30850008e91ba9

@fengmk2 fengmk2 self-assigned this Apr 4, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 4, 2026


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 force-pushed the windows-installer branch from 1b3a6a3 to 4dc36b5 Compare April 4, 2026 12:59
@fengmk2 fengmk2 force-pushed the windows-installer branch from 672909f to 816d7f1 Compare April 4, 2026 15:07

## Code Signing

Windows Defender SmartScreen flags unsigned executables downloaded from the internet. This is a significant UX problem for a download-and-run installer.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image.png

Need to resolve the signature issue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Brooooooklyn @yyx990803 Has the digital signature certificate been approved? This feature requires it.

Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 5, 2026

image.png

Double-click execution effect

@fengmk2 fengmk2 force-pushed the windows-installer branch from 4fe6fd3 to a87b42c Compare April 5, 2026 05:23
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 5, 2026

Manual Testing Plan: vp-setup.exe Windows Installer

Prerequisites

  • Windows 10/11 machine (x64 or ARM64)
  • Build vp-setup.exe locally or download from the PR's CI artifacts
  • Clean state: no existing ~/.vite-plus directory (back up and remove if present)

1. Fresh Install — Double-Click

  • 1.1 Download vp-setup.exe to Downloads folder → Browser shows SmartScreen warning
  • 1.2 Click "..." → "Keep" → "Keep anyway" → File saved
  • 1.3 Double-click vp-setup.exe → Console window opens, interactive menu displayed
  • 1.4 Press Enter (default: Proceed) → Installation runs, success message shown
  • 1.5 Verify "Press Enter to close..." prompt → Window stays open until Enter pressed
  • 1.6 Open a new terminal, run vp --version → Version printed
  • 1.7 Run vp --help → Help output shown

2. Fresh Install — Shell Invocations

  • 2.1 Run from PowerShell: .\vp-setup.exe → Interactive menu shown
  • 2.2 Run from cmd.exe: vp-setup.exe → Interactive menu shown
  • 2.3 Run from Git Bash: ./vp-setup.exe → Interactive menu shown
  • 2.4 Run with -y: vp-setup.exe -y → No prompts, installs directly, exits without pause

3. Interactive Menu — Customize

  • 3.1 At main menu, press 2 (Customize) → Customize submenu shown with 4 options
  • 3.2 Press 1, type 0.1.14-alpha.1, Enter → Version changes to 0.1.14-alpha.1
  • 3.3 Press 3 to toggle Node.js manager → Toggles between "enabled" / "disabled"
  • 3.4 Press 4 to toggle Modify PATH → Toggles between "yes" / "no"
  • 3.5 Press Enter to go back → Main menu shows updated values
  • 3.6 Press 3 (Cancel) → "Installation cancelled." printed

4. Node.js Manager Auto-Detection

  • 4.1 System has Node.js installed, run interactively → Node.js manager defaults to "enabled"
  • 4.2 System has Node.js installed, run with -y → Node.js manager defaults to "disabled" (no shim takeover)
  • 4.3 Set VP_NODE_MANAGER=no, run → Node.js manager disabled regardless of mode
  • 4.4 Set VP_NODE_MANAGER=yes, run with -y → Node.js manager enabled even in silent mode

5. Same-Version Repair

  • 5.1 With vp already installed, run vp-setup.exe -y → Prints "already installed, verifying setup...", skips download
  • 5.2 Delete ~/.vite-plus/bin/vp.exe, run vp-setup.exe -y → Repairs: recreates bin shim, vp --version works after
  • 5.3 Remove ~/.vite-plus/bin from User PATH, run vp-setup.exe -y → Repairs: PATH re-added

6. Upgrade Path

  • 6.1 Install an older version: vp-setup.exe -y --version 0.1.14-alpha.1 → Installs specified version
  • 6.2 Run vp-setup.exe -y (no version flag) → Upgrades to latest, prints "upgrading from X to Y"
  • 6.3 Run vp upgrade --rollback → Rolls back to the previous version

7. Post-Installation Verification

  • 7.1 Check ~/.vite-plus/current → Junction points to installed version dir
  • 7.2 Check ~/.vite-plus/bin/vp.exe → Exists (trampoline shim)
  • 7.3 Check User PATH ($env:Path) → Contains ~/.vite-plus/bin
  • 7.4 Run vp env doctor → No errors
  • 7.5 Run vp create vite -- test-app --no-interactive -t vanilla → Project created successfully
  • 7.6 cd test-app && vp run build → Build succeeds

8. Environment Variables

  • 8.1 Set VP_VERSION=0.1.14-alpha.1, run vp-setup.exe -y → Installs specified version
  • 8.2 Set VP_HOME=C:\custom-dir, run vp-setup.exe -y → Installs to custom directory
  • 8.3 Set CI=true, run vp-setup.exe (no -y) → Runs non-interactively (no prompts)

9. Error Handling

  • 9.1 Run with --version nonexistent-version → Error message, exit code 1
  • 9.2 Run with no internet connection → Error message about network/registry
  • 9.3 Run with --no-modify-path → Installs successfully, PATH not modified

@fengmk2

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@fengmk2 fengmk2 force-pushed the windows-installer branch from a8c95ab to aa5dfc2 Compare April 7, 2026 02:59

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@fengmk2 fengmk2 force-pushed the windows-installer branch 2 times, most recently from e88ee5c to 29f821e Compare April 8, 2026 02:31
@fengmk2

This comment was marked as outdated.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29f821e61f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 marked this pull request as ready for review April 8, 2026 05:40
@fengmk2 fengmk2 requested review from branchseer and cpojer April 8, 2026 05:40
@fengmk2 fengmk2 force-pushed the windows-installer branch from 29f821e to ac2513f Compare April 8, 2026 06:18
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@fengmk2 fengmk2 force-pushed the windows-installer branch from ff4b269 to 9af5ac7 Compare April 8, 2026 09:00
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from 8c3e6f5 to ead0919 Compare April 8, 2026 14:27
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from ead0919 to e4b8fe2 Compare April 8, 2026 14:33
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from e4b8fe2 to 2ece316 Compare April 8, 2026 14:36
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from 2ece316 to 7fa71e2 Compare April 8, 2026 14:42
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from 7fa71e2 to ba538e1 Compare April 8, 2026 14:44
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba538e199b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Apr 8, 2026
fengmk2 added a commit that referenced this pull request Apr 8, 2026
Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from ba538e1 to 3376eb0 Compare April 8, 2026 16:11
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3376eb0089

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Add a standalone `vp-setup.exe` Windows installer that installs the vp
CLI without requiring PowerShell, complementing the existing `install.ps1`.

Architecture:
- New `vite_setup` shared library crate extracting installation logic
  (platform detection, registry queries, integrity verification, tarball
  extraction, symlink/junction management) from `vite_global_cli`
- New `vite_installer` binary crate producing `vp-setup.exe`

Features:
- Interactive menu with customize submenu (version, registry, Node.js
  manager, PATH modification)
- Silent mode via `-y` or auto-detected CI environment
- Node.js manager auto-detection matching install.ps1/install.sh logic
- Same-version repair (skips download, reruns post-activation setup)
- Windows PATH modification via `winreg` crate
- DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories)
- ANSI color support with fallback for legacy Windows consoles
- Respects NO_COLOR env var
- Post-activation steps are best-effort (non-fatal)
- "Press Enter to close..." pause in interactive mode
- VP_HOME propagated to child processes for custom install dirs

CI:
- Build + cache installer in release workflow
- Attach as GitHub Release assets
- Test job in test-standalone-install.yml

Docs:
- RFC at rfcs/windows-installer.md
- Installation guide updated with vp-setup.exe download link
- SmartScreen warning guide added

Closes #1293
@fengmk2 fengmk2 force-pushed the windows-installer branch from 3376eb0 to 2e26da4 Compare April 8, 2026 16:24
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e26da4d31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

install::install_production_deps(
&version_dir,
opts.registry.as_deref(),
opts.quiet,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use non-interactive flag for release-age prompt gating

vp-setup -y is documented as non-interactive, but this call passes opts.quiet into install_production_deps, so the release-age fallback prompt is still shown whenever -y is used without -q and stdin/stderr are terminals. In that case unattended installs can block waiting for input instead of honoring --yes defaults; pass a non-interactive signal (e.g. opts.yes) rather than the quiet flag.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants